<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml"
      xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>区域经理意向客户列表</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link rel="stylesheet" href="/dist/plugins/select2/select2.min.css">
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=39cd89cd">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style>
        .webuploader-pick {
            padding: 3px 0;
            padding-left: 15px;
            background: none;
        }

        .left {
            width: 180px;
            float: left;
        }

        .right {
            margin-left: 190px;
        }

        .lineF span {
            max-height: 140px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 7;
            text-align: left;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .moduleName {
            float: left;
            height: 27px;
            line-height: 27px;
            font-size: 22px;
            width: 100px;
            text-align: center;
        }

        .tryStyle {
            width: 30px;
            height: 14px;
            line-height: 14px;
            font-size: 12px;
            /* top: 0; */
            right: 0;
            position: absolute;
            border-radius: 5px;
            margin-top: 1px;
            background: red;
            color: #fff;
            margin-right: -2px;
            transform: scale(0.8);
        }

        .nav-tabs-custom {
            padding: 10px;
            margin-bottom: 0;
            box-shadow: none;
            position: relative;
            overflow: hidden;
        }

        .infoReport {
            display: flex;
            justify-content: flex-start;
            text-align: left;
            margin-left: 10px;
        }

        .infoReport div {
            margin: 0 10px;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .lineOneNoMore {
            text-align: left;
        }

        .lineOneNoMore span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .mScrollBox {
            float: left;
            position: relative;
        }

        .imgStyle {
            width: 300px;
            height: 400px;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .templateStyle {
            border: 1px solid #ddd;
        }

        .table > thead > tr > th {
            padding: 0;
        }

        .table > tbody > tr > td {
            position: relative;
        }

        .table > tbody > tr > td {
            height: 30px;
            max-height: 28px;
            overflow: hidden;
        }

        .jiaobiao3 {
            position: relative;
        }

        .jiaobiao3 i {
            display: block;
            width: 6px;
            height: 6px;
            background: url("/dist/img/newLog3.png");
            position: absolute;
            top: 0px;
            right: 0px;
        }
    </style>
</head>
<body>
<section class="content" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>
    <!--区域经理模块-->
    <div>
        <div class="row">
            <div style="padding: 0 10px;background: #fff;" id="customersGroup">
                <div class="nav-tabs-custom oaReportNav" style="width: 100%;">
                    <ul class="nav nav-tabs pull-right" style="margin-bottom: 10px;" v-cloak>
                        <li  @click="getCustomerListByCreateUserId('')" class="active">
                            <a href="#sales-chart" data-toggle="tab">全部</a>
                        </li>
                        <li @click="getCustomerListByCreateUserId('一周内')" :class="isActive('一周内')?'active':''">
                            <a href="#sales-chart" data-toggle="tab">一周内</a>
                        </li>
                        <li @click="getCustomerListByCreateUserId('一月内')" :class="isActive('一月内')?'active':''">
                            <a href="#sales-chart" data-toggle="tab">一月内</a>
                        </li>
                        <li  @click="getCustomerListByCreateUserId('三月内')" :class="isActive('三月内')?'active':''">
                            <a href="#sales-chart" data-toggle="tab">三月内</a>
                        </li>
                        <li  @click="getCustomerListByCreateUserId('半年内')" :class="isActive('半年内')?'active':''">
                            <a href="#sales-chart" data-toggle="tab">半年内</a>
                        </li>
                        <li  @click="getCustomerListByCreateUserId('已成交')" :class="isActive('已成交')?'active':''">
                            <a href="#sales-chart" data-toggle="tab">已成交</a>
                        </li>
                        <li  @click="getCustomerListByCreateUserId('丢单')" :class="isActive('丢单')?'active':''">
                            <a href="#sales-chart" data-toggle="tab">丢单</a>
                        </li>
                        <li>

                        </li>
                    </ul>
                    <button type="button" class="btn oaBtn pull-right btn-sm"  style="height: 25px;float: right;margin-top: -40px "
                            @click="goDetail('',userId,'look',1)">
                        新增意向客户
                    </button>
                </div>
                <div style="width: 100%;" class="mScrollBox">
                    <table class="table table-hover table-bordered text-center table-striped">
                        <thead>
                        <tr>
                            <th style="width: 27px;">序号</th>
                            <th style="width: 55px;">客户姓名</th>
                            <th style="width: 91px;">客户电话</th>
                            <th style="width: 64px;">客户类型</th>
                            <th style="width: 50px;">客户信用</th>
                            <th style="width: 85px;">客户所在地</th>
                            <th style="width: 55px;">购买时间</th>
                            <th style="width: 65px;">意向机型</th>
                            <th style="width: 55px;">购买方式</th>
                            <th style="width: 75px;">本月成交概率</th>
                            <th style="width: 96px;">商机确认日期</th>
                            <th> 基本情况</th>
                        </tr>
                        </thead>
                        <tbody>
                        <template v-if="customerList.length>0">
                            <tr v-for="(item,i) in customerList">
                                <td>{{i+1}}</td>
                                <td @click="goDetail(item.customerId,item.createUserId,'edit',0)">
                                    <span  style="text-align:center;color:#169BD5;cursor: pointer; " >{{item.customerName}}</span>
                                </td>
                                <td>{{item.customerTel}}</td>
                                <td>{{item.customerType}}</td>
                                <td>{{item.customerCredit}}</td>
                                <td class='td-tanZongStyle-line'>
                                    <span class="lineOne" style="text-align: center;max-height: 24px">{{item.provinceName}}-{{item.cityName}}-{{item.countyName}}</span>
                                </td>
                                <td>{{item.buyDate}}</td>
                                <td  class="lineOne">{{item.intentionModel}}</td>
                                <td>{{item.buyType}}</td>
                                <td>
                                    {{item.chance}}
                                </td>
                                <td>{{item.businessDate}}</td>
                                <td class="lineOne"><span>{{item.otherCondition}}</span></td>
                            </tr>
                        </template>
                        <template v-else>
                            <tr>
                                <td colspan="12">暂无{{buyDate?buyDate:''}}意向客户</td>
                            </tr>
                        </template>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</section>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=8e743a31"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=54c6b89c"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<scripst type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></scripst>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<!--ztree组件所需js-->
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>

<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script>
    function refresh() {
        app.getCustomerListByCreateUserId();
    }
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo,.lineF", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            roleName:getCurrentUser().roleName,
            userId:getCurrentUser().id,
            key:'',
            buyDate:'',
            customerList:[],
        },
        methods: {
            getCustomerListByCreateUserId: function (buyDate) {
                var that = this;
                that.buyDate=buyDate;
                $.wyui.postMethod(urlConfig.intentionCustomerManagement.getCustomerListByCreateUserId, {
                    "userId": that.userId,
                    "buyDate": buyDate,
                    "key": that.key
                }, function (data) {
                    that.customerList = data.records;
                });

            },
            goDetail: function (customerId, createUserId, pageType, isAdd) {
                var that = this;
                var H = $(window).height() - 50;
                if (!((createUserId) == (getCurrentUser().id))) {
                    pageType = 'look';
                }
                $.dialog({
                    content: 'url:/page/intentionManagement/intentCustomerPc/quYuIntentionalDetail.html?pageType=' + pageType + "&customerId=" + customerId + "&userId=" + getCurrentUser().id + "&isAdd=" + isAdd+ "&isRegion=1",
                    title: '意向客户详情',
                    width: 400,
                    height: H,
                    max: true,
                    min: true,
                    lock: true
                });
            },
            goDaQuList: function (userId) {
                var that = this;
                window.location.href = "/page/intentionManagement/intentCustomerPc/daQuIntentionalList.html" ;
            },
            goManagerList: function (userId) {
                var that = this;
                window.location.href = "/page/intentionManagement/intentCustomerPc/managerIntentionalList.html" ;
            },
            goGroupList: function (userId) {
                var that = this;
                window.location.href = "/page/intentionManagement/intentCustomerPc/groupIntentionalList.html" ;
            },
            isActive:function (item) {
                var that=this;
                if(that.num==item){
                    return true;
                }
            },

        },
        mounted: function () {
            var that = this;
            if(that.roleName=='区域经理'){
                that.getCustomerListByCreateUserId("");
            }else if (that.roleName=='大区经理'||that.roleName=='区域组长'){
                that.goDaQuList();
            }else if (that.roleName=='区域总监'||that.roleName=='销售总监'||that.roleName=='区域支持'||that.roleName=='销售管理'||that.roleName=='总经理'){
                that.goManagerList();
            }else {
                that.goGroupList();
            }
        }
    });
</script>
</body>
</html>